type TObj={[key: string]: any};
function _assign(obj: TObj, obj1: TObj, ignoreKeys: string[] = []) {
    for(let key in obj1) {
        if(ignoreKeys.indexOf(key) !== -1) continue;
        if(Object.prototype.toString.call(obj1[key]) === '[object Object]') {
            let origin = obj[key];
            if(origin === undefined) {
                origin = {};
            }
            obj[key] = _assign(origin, obj1[key]);
            continue;
        }
        obj[key] = obj1[key];
    }
    return obj;
}
export function assign(...args: TObj[]) {
    let result:TObj = {};
    for(let item of args) {
        result = _assign(result, item);
    }
    return result;
}